﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


/// <summary>
///UserControlBase 的摘要说明
/// </summary>
public class UserControlBase : System.Web.UI.UserControl
{
	public UserControlBase()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    public Chenxin.Lib.Passport.BLL.Cache_UserInfo CurrentUserInfo
    {
        get
        {
            //用户Id
            string strUserId;
            //从Cookies取得用户Id
            string strRequestKey = Request.Cookies["requestkey"].Value;
            string strCachedKey = string.Format(Chenxin.Lib.Cache.CacheDataType.GLOBAL_REQUEST, strRequestKey);
            Chenxin.Lib.Cache.CacheService cs = new Chenxin.Lib.Cache.CacheService(Chenxin.Lib.Cache.CacheConn.xCacheConn.GLOBAL);
            strUserId = cs.GetString(strCachedKey);
            if (!cs.Hit)
                Response.Redirect("~/loginex.aspx", true);

            //用户基本信息业务类
            Chenxin.Lib.Passport.BLL.Cache_UserInfo bllCacheUserInfo = new Chenxin.Lib.Passport.BLL.Cache_UserInfo(new Guid(strUserId));
            //得到当前用户信息
            return bllCacheUserInfo.GetCurrentUserInfo();
        }
    }
}
